//
//  CourseCell.m
//  YUXiu
//
//  Created by wang on 16/6/25.
//  Copyright © 2016年 Wang. All rights reserved.
//

#import "CourseCell.h"

@interface CourseCell ()

@property (nonatomic,strong) UIImageView *hdView;
@property (nonatomic,strong) UILabel *nameL;
@property (nonatomic,strong) UIImageView *sexImg;
@property (nonatomic,strong) UIButton *level;

@end
@implementation CourseCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
//初始化方法里创建
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
   self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        //
        _hdView = [[UIImageView alloc]initWithFrame:krect(20, 10, 40, 40)];
        [self.contentView addSubview:_hdView];
        
        _nameL = [[UILabel alloc]initWithFrame:krect(70, 20, 60, 20)];
        _nameL.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:_nameL];
        
        _sexImg = [[UIImageView alloc]initWithFrame:krect(_nameL.golf_right, 20, 22, 22)];
        [self.contentView addSubview:_sexImg];
        
        _level = [[UIButton alloc]initWithFrame:krect(_sexImg.golf_right+5, 20, 60, 22)];
        _level.layer.cornerRadius = 3;
        _level.clipsToBounds= YES;
        _level.backgroundColor = kOrangeCOLOR;
        
        [self.contentView addSubview:_level];
    
        UIView *lin = [[UIView alloc]initWithFrame:krect(3, 59, kScreenWidth-6, 1)];
        lin.backgroundColor = kLightGrayCOLOR;
        [self.contentView addSubview:lin];
    }
    
    return self;
}
//这里赋值
-(void)layoutSubviews{
    
   
    [_hdView setImage:[UIImage imageNamed:@"header"]];
   _nameL.text = @"松山";
    [_sexImg setImage:[UIImage imageNamed:@"header"]];

    
    
    
    
}
@end
